package edu.zhuoxun.blogserver.controller;

import edu.zhuoxun.blogserver.entity.Result;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {
    @RequestMapping("api/test")
    @CrossOrigin
    @ResponseBody
    public Result<String> getTest() {
        Result<String> result = new Result<>();
        result.setCode(200);
        result.setMessage("授权测试");
        return result;
    }
    @RequestMapping("api/unauth")
    @CrossOrigin
    @ResponseBody
    public Result<String> getUnauth() {
        Result<String> result = new Result<>();
        result.setCode(305);
        result.setMessage("权限不足");
        return result;
    }
}
